//
//  SystemTableCell.m
//  OperationPro
//
//  Created by yaxue wang on 16/11/4.
//  Copyright © 2016年 展鸿科技. All rights reserved.
//

#import "SystemTableCell.h"
#import "SystemModel.h"
#import "SystemTableCell.h"
@implementation SystemTableCell
- (void)initView{
    [super initView];
    self.backgroundColor =BackColor;
    
    self.timeLab = [[UILabel alloc]init];
    [self addSubview:self.timeLab];
    [self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(@(30));
        make.top.equalTo(self);
        make.centerX.equalTo(self);
    }];
    self.timeLab.textColor =LightFontColor;
    self.timeLab.backgroundColor=[UIColor clearColor];
    self.timeLab.font =F(10);
    self.timeLab.textAlignment=NSTextAlignmentCenter;
    
    self.cellBg =[[UIView alloc]init];
    [self addSubview:self.cellBg];
    self.cellBg.backgroundColor=[UIColor whiteColor];
    [self.cellBg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(18);
        make.top.equalTo(self.timeLab.mas_bottom);
        make.right.equalTo(self.mas_right).offset(-18);
        make.bottom.equalTo(self);
        
    }];
    self.cellBg.layer.masksToBounds=YES;
    self.cellBg.layer.cornerRadius=10;
    self.cellBg.layer.borderColor=LineColor.CGColor;
    self.cellBg.layer.borderWidth=0.5;
    
    self.nameLab = [[UILabel alloc]init];
    [self.cellBg addSubview:self.nameLab];
    [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.cellBg).offset(15);
        make.top.equalTo(self.cellBg).offset(23);
        make.right.equalTo(self.cellBg.mas_right).offset(-15);
    }];
    self.nameLab.textColor =FontColor;
    self.nameLab.font =F(14);
    self.nameLab.numberOfLines=0;
    
    self.contexLab =[[UILabel alloc]init];
    [self.cellBg addSubview:self.contexLab];
    [self.contexLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLab);
        make.right.equalTo(self.nameLab);
        make.bottom.equalTo(self.cellBg).offset(-15);
        
    }];
    self.contexLab.textColor =LightFontColor;
    self.contexLab.font =F(12);
    self.contexLab.numberOfLines=0;
    self.contexLab.textAlignment =NSTextAlignmentLeft;
    
    
}
- (void)setModel:(id)model{
    
    
    SystemModel *order = model;
    self.nameLab.text=order.S_title;
    self.timeLab.text=order.S_created;
    self.contexLab.text=order.S_brief;
}

@end
